package com.belano.controller;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.belano.catalog.PersonCatalog;
import com.belano.domain.People;

@Component
@Path("protected")
@Produces("application/xml")
public class ProtectedController {

	private PersonCatalog personCatalog;

	@Autowired
	public void setPersonCatalog(PersonCatalog personCatalog) {
		this.personCatalog = personCatalog;
	}
	
	@GET
	public People getAll() {		
		return new People(personCatalog.getPeople());
	}
	
}
